<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
/**
 * класс блок гостевая книга
 */
class block_guestbook extends block_base {
	public function init() {
		$this->title = get_string('pluginname', 'block_guestbook');
	}
	public function instanse_allow_multiple() {
    	return true;
    }
	public function get_content() {
		if ($this->content !== null) {
   			return $this->content;
		}
    	$this->content         = new stdClass; 
		//ссылка на гостевую
		$url = new moodle_url('/blocks/guestbook/view.php');
    	$this->content->text = html_writer::link($url, get_string('pluginname', 'block_guestbook'));
		return $this->content;
	}
	public function specialization() {
		if (!empty($this->config->title)) {
    		$this->title = $this->config->title;
    	} else {
    		$this->config->title = 'Default title ...';
    	}
    	
    	if(empty($this->config->text)) {
    		$this->config->text = 'Default text ...';
    	}
	}
	
}
